#pragma once
#include "afxwin.h"
#include "cvxImage.h"
#include "DeckLinkAPI_h.h"


struct SCameraConfigure
{
	float fx, fy;
	float cx, cy;
	float k1, k2, p1, p2, k3;
	float fl;                //physical focal length
};
struct SCameraRigConfigure
{
	SCameraConfigure left;
	SCameraConfigure right;
	int zoomLevel;
};
// COpitionsDlg dialog

class COpitionsDlg : public CDialog
{
	DECLARE_DYNAMIC(COpitionsDlg)

public:
	COpitionsDlg(CWnd* pParent = NULL);   // standard constructor
	virtual ~COpitionsDlg();

	//added
	void AddDeviceName(const CString & name);
	CvSize GetSize();	
	bool Binocular();
	int GetChannels();
	void GetFormat(BMDDisplayMode &displayMode,	BMDPixelFormat &pixelFormat, int &flag);
	int GetRightFlipFlag(void);
	bool startCalib();
	bool isShowIA();
	bool isDenseCalib();
	void GetCameraConfigure(SCameraConfigure &left, SCameraConfigure &right);
	float GetFps();

	//added
private:


// Dialog Data
	enum { IDD = IDD_OPINIONS };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()

public:
	virtual BOOL OnInitDialog();
protected:
public:
	// input device type
	CComboBox m_inputDevice;
	// video Format type from camera
	CComboBox m_videoFormat;
	
	//point to inputDevice (only one instance)

	afx_msg void OnCbnSelchangeOpitionsVideoFormat();
	// pixel format from camera
	CComboBox m_pixelFormat;
	// whether stereo or just left image
	CButton m_stereoCheck;
	afx_msg void OnBnClickedOpinionsStereo();
	// flip right image vertically
	CButton m_flipRightV;
	afx_msg void OnCbnSelchangeOpinionPixelFromat();
protected:
	// camera name or type, it just support Canon Xf105
	CEdit m_cameraName;

	// zoom levels that is supported by camera configuration file.and current camera zoom level
	CComboBox m_supportZoomLevels;
	
	
	//camera confiures
	vector<SCameraRigConfigure> m_configures;

public:
	afx_msg void OnBnClickedLoadCameraConfigure();
	
protected:
	// state can calibrate extinsic parameters
	CButton m_startCalib;
	// focal length of left and right camera in mm unit
	CEdit m_opFocalLength;
	// show inter axis distance in mechnical alignment
	CButton m_opShowIA;
public:
	afx_msg void OnBnClickedNeedCalib();
	afx_msg void OnCbnSelchangeSupportZoomLevels();
	afx_msg void OnBnClickedOpShowIa();
protected:
	// whether use dense calib
	CButton m_opDenseCalib;
public:
	afx_msg void OnBnClickedDenseCalib();
protected:
	// frame per second of capture
	CComboBox m_captureFPS;
};
